/**
 * 荣誉搜索相关接口
 */
import { request } from "@/utils/request";

const baseSuffix = '/ht-nonrealtime-gameservice'
const htUserBaseSuffix = '/ht-user'
/**
 * 获取荣誉数据库查询标签字段
 * @param data
 * @returns {Promise<unknown>}
 */
export const getConfigEnterpriseFieldsApi = async data => {
    return request({
        url: `${baseSuffix}/configFields/getConfigEnterpriseFields`,
        type: 'application/x-www-form-urlencoded',
        method: 'GET',
        data
    })
}

/**
 * 获取荣耀年份
 * @returns {Promise<unknown>}
 */
export const getHonourYearsListApi = async () => {
    return request({
        url: `${htUserBaseSuffix}/enterprise/grantEnterpriseFindLabel`,
        methods: 'GET',
    })
}

/**
 * 获取热搜榜
 * @returns {Promise<unknown>}
 */
export const getTopSearchApi = async (type) => {
    return request({
        url: `${baseSuffix}/topSearch/getTopSearch`,
        method: 'POST',
        type: 'application/x-www-form-urlencoded',
        data: {
            type:type
        }
    })
}

/**
 * 荣誉库企业查询
 * @param data
 * @returns {Promise<unknown>}
 */
export const getAppEnterpriseListApi = async data => {
    return request({
        url: `${htUserBaseSuffix}/enterprise/getAppEnterpriseList`,
        method: 'POST',
        data
    })
}

export const getEnterpriseHonorCountDetailsApi = async data => {
    return request({
        url: `${htUserBaseSuffix}/enterprise/getEnterpriseHonorCountDetails`,
        method: 'GET',
        data
    })
}
